﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace CSharp.Libs.Koc.ItemClasses
{
    /// <summary>KnightItem</summary>
    /// <history>created  15.02.2012</history>
    public class KnightItem
    {
        #region declarations
        Int64 _intKnightId = 0; 
        Int64 _intKnightFbuid = 0;
        Int64 _intKnightLordUserid = 0;
        string _strKnightName = "";
        Int64 _intKnightLevel = 0;
        Int64 _intSkillPointsApplied = 0;
        Int64 _intBaseResourcefulness = 0;
        Int64 _intBasePolitics = 0;
        Int64 _intBaseCombat = 0;
        Int64 _intBaseIntelligence = 0;
        Int64 _intExperience = 0;
        Int64 _intResourcefulness = 0;
        Int64 _intPolitics = 0;
        Int64 _intCombat = 0;
        Int64 _intIntelligence = 0;
        Int64 _intResourcefulnessBoostExpiration = 0;
        Int64 _intPoliticsBoostExpiration = 0;
        Int64 _intCombatBoostExpiration = 0;
        Int64 _intIntelligenceBoostExpiration = 0;
        Int64 _intLoyalty = 0;
        Int64 _intLoyaltyTimestamp = 0;
        Int64 _intKnightStatus = 0;
        Int64 _intCityId = 0;
        Int64 _intResourcefulnessBoostExpireUnixtime = 0;
        Int64 _intPoliticsBoostExpireUnixtime = 0;
        Int64 _intCombatBoostExpireUnixtime = 0;
        Int64 _intIntelligenceBoostExpireUnixtime = 0;
        Int64 _intLoyaltyUnixtime = 0;
        string _strPic_square = "";
        #endregion



        #region constructor / terminator
        public KnightItem()
        {
        }

        public KnightItem(
            Kernel KRNL,
            Hashtable htKnightItem)
        {
            _readKnightItem(KRNL, htKnightItem);
        }
        #endregion



        #region event handling
        #endregion



        #region private functions
        private void _readKnightItem(
            Kernel KRNL,
            Hashtable htKnightItem)
        {
            try
            {
                _intKnightId = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_ID, KernelTools.VariableTypes.Int64);
                _intKnightFbuid = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_FBUID, KernelTools.VariableTypes.Int64);
                _intKnightLordUserid = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_LORD_USER_ID, KernelTools.VariableTypes.Int64);
                _strKnightName = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_NAME, KernelTools.VariableTypes.String);
                _intKnightLevel = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_LEVEL, KernelTools.VariableTypes.Int64);
                _intSkillPointsApplied = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_SKILL_POINTS_APPLIED, KernelTools.VariableTypes.Int64);
                _intBaseResourcefulness = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_BASE_RESOURCEFULNESS, KernelTools.VariableTypes.Int64);
                _intBasePolitics = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_BASE_POLITICS, KernelTools.VariableTypes.Int64);
                _intBaseCombat = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_BASE_COMBAT, KernelTools.VariableTypes.Int64);
                _intBaseIntelligence = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_BASE_INTELLIGENCE, KernelTools.VariableTypes.Int64);
                _intExperience = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_EXPERIENCE, KernelTools.VariableTypes.Int64);
                _intResourcefulness = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_RESOURCEFULNESS, KernelTools.VariableTypes.Int64);
                _intPolitics = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_POLITICS, KernelTools.VariableTypes.Int64);
                _intCombat = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_COMBAT, KernelTools.VariableTypes.Int64);
                _intIntelligence = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_INTELLIGENCE, KernelTools.VariableTypes.Int64);
                
                //
                _intResourcefulnessBoostExpiration = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_RESOURCEFULNESS_BOOST_EXPIRATION, KernelTools.VariableTypes.Int64);
                _intPoliticsBoostExpiration = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_POLITICS_BOOST_EXPIRATION, KernelTools.VariableTypes.Int64);
                _intCombatBoostExpiration= KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_COMBAT_BOOST_EXPIRATION, KernelTools.VariableTypes.Int64);
                _intIntelligenceBoostExpiration = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_INTELLIGENCE_BOOST_EXPIRATION, KernelTools.VariableTypes.Int64);
                //

                _intLoyalty = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_LOYALTY, KernelTools.VariableTypes.Int64);
                
                //
                _intLoyaltyTimestamp = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_LOYALTY_TIMESTAMP, KernelTools.VariableTypes.Int64);
                //

                _intKnightStatus = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_KNIGHT_STATUS, KernelTools.VariableTypes.Int64);
                _intCityId= KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_CITY_ID, KernelTools.VariableTypes.Int64);
                _intResourcefulnessBoostExpireUnixtime = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_RESOURCEFULNESS_BOOST_EXPIRE_UNIX_TIME, KernelTools.VariableTypes.Int64);
                _intPoliticsBoostExpireUnixtime = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_POLITICS_BOOST_EXPIRE_UNIX_TIME, KernelTools.VariableTypes.Int64);
                _intCombatBoostExpireUnixtime = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_COMBAT_BOOST_EXPIRE_UNIX_TIME, KernelTools.VariableTypes.Int64);
                _intIntelligenceBoostExpireUnixtime = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_INTELLIGENCE_BOOST_EXPIRE_UNIX_TIME, KernelTools.VariableTypes.Int64);
                _intLoyaltyUnixtime = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_LOYALTY_UNIX_TIME, KernelTools.VariableTypes.Int64);
                _strPic_square = KRNL.GetHashtableValue(htKnightItem, constants.KEY_SEED_PIC_SQUARE, KernelTools.VariableTypes.String);
            }
            catch (Exception ex)
            {
                KRNL.EC.AddException(ex, this.ToString(), KRNL.EC.Tools.GetCurrentMethodName());
            }
        }
        #endregion



        #region interface
        #region properties
        public Int64 KnightId
        {
            get
            {
                return _intKnightId;
            }
            set
            {
                _intKnightId = value;
            }
        }

        public Int64 KnightFbuid
        {
            get
            {
                return _intKnightFbuid;
            }
            set
            {
                _intKnightFbuid = value;
            }
        }

        public Int64 KnightLordUserid
        {
            get
            {
                return _intKnightLordUserid;
            }
            set
            {
                _intKnightLordUserid = value;
            }
        }

        public string KnightName
        {
            get
            {
                return _strKnightName;
            }
            set
            {
                _strKnightName = value;
            }
        }

        public Int64 KnightLevel
        {
            get
            {
                return _intKnightLevel;
            }
            set
            {
                _intKnightLevel = value;
            }
        }

        public Int64 SkillPointsApplied
        {
            get
            {
                return _intSkillPointsApplied;
            }
            set
            {
                _intSkillPointsApplied = value;
            }
        }

        public Int64 BaseResourcefulness
        {
            get
            {
                return _intBaseResourcefulness;
            }
            set
            {
                _intBaseResourcefulness = value;
            }
        }

        public Int64 BasePolitics
        {
            get
            {
                return _intBasePolitics;
            }
            set
            {
                _intBasePolitics = value;
            }
        }

        public Int64 BaseCombat
        {
            get
            {
                return _intBaseCombat;
            }
            set
            {
                _intBaseCombat = value;
            }
        }

        public Int64 BaseIntelligence
        {
            get
            {
                return _intBaseIntelligence;
            }
            set
            {
                _intBaseIntelligence = value;
            }
        }

        public Int64 Experience
        {
            get
            {
                return _intExperience;
            }
            set
            {
                _intExperience = value;
            }
        }

        public Int64 Resourcefulness
        {
            get
            {
                return _intResourcefulness;
            }
            set
            {
                _intResourcefulness = value;
            }
        }

        public Int64 Politics
        {
            get
            {
                return _intPolitics;
            }
            set
            {
                _intPolitics = value;
            }
        }

        public Int64 Combat
        {
            get
            {
                return _intCombat;
            }
            set
            {
                _intCombat = value;
            }
        }

        public Int64 Intelligence
        {
            get
            {
                return _intIntelligence;
            }
            set
            {
                _intIntelligence = value;
            }
        }

        public Int64 ResourcefulnessBoostExpiration
        {
            get
            {
                return _intResourcefulnessBoostExpiration;
            }
            set
            {
                _intResourcefulnessBoostExpiration = value;
            }
        }

        public Int64 PoliticsBoostExpiration
        {
            get
            {
                return _intPoliticsBoostExpiration;
            }
            set
            {
                _intPoliticsBoostExpiration = value;
            }
        }

        public Int64 CombatBoostExpiration
        {
            get
            {
                return _intCombatBoostExpiration;
            }
            set
            {
                _intCombatBoostExpiration = value;
            }
        }

        public Int64 IntelligenceBoostExpiration
        {
            get
            {
                return _intIntelligenceBoostExpiration;
            }
            set
            {
                _intIntelligenceBoostExpiration = value;
            }
        }

        public Int64 Loyalty
        {
            get
            {
                return _intLoyalty;
            }
            set
            {
                _intLoyalty = value;
            }
        }

        public Int64 LoyaltyTimestamp
        {
            get
            {
                return _intLoyaltyTimestamp;
            }
            set
            {
                _intLoyaltyTimestamp = value;
            }
        }

        public Int64 KnightStatus
        {
            get
            {
                return _intKnightStatus;
            }
            set
            {
                _intKnightStatus = value;
            }
        }

        public Int64 CityId
        {
            get
            {
                return _intCityId;
            }
            set
            {
                _intCityId = value;
            }
        }

        public Int64 ResourcefulnessBoostExpireUnixtime
        {
            get
            {
                return _intResourcefulnessBoostExpireUnixtime;
            }
            set
            {
                _intResourcefulnessBoostExpireUnixtime = value;
            }
        }

        public Int64 PoliticsBoostExpireUnixtime
        {
            get
            {
                return _intPoliticsBoostExpireUnixtime;
            }
            set
            {
                _intPoliticsBoostExpireUnixtime = value;
            }
        }

        public Int64 CombatBoostExpireUnixtime
        {
            get
            {
                return _intCombatBoostExpireUnixtime;
            }
            set
            {
                _intCombatBoostExpireUnixtime = value;
            }
        }

        public Int64 IntelligenceBoostExpireUnixtime
        {
            get
            {
                return _intIntelligenceBoostExpireUnixtime;
            }
            set
            {
                _intIntelligenceBoostExpireUnixtime = value;
            }
        }

        public Int64 LoyaltyUnixtime
        {
            get
            {
                return _intLoyaltyUnixtime;
            }
            set
            {
                _intLoyaltyUnixtime = value;
            }
        }

        public string Pic_square
        {
            get
            {
                return _strPic_square;
            }
            set
            {
                _strPic_square = value;
            }
        }
        #endregion

        #region methods
        /// <summary>ReadKnightItem</summary>
        /// <param name="KRNL"></param>
        /// <param name="htKnightItem"></param>
        /// <history>created  15.02.2012</history>
        public void ReadKnightItem(
            Kernel KRNL,
            Hashtable htKnightItem)
        {
            _readKnightItem(KRNL, htKnightItem);
        }
        #endregion
        #endregion
    }
}
